package com.example.hotel.service.impl;

import com.example.hotel.dao.ResidentDao;
import com.example.hotel.entity.Resident;
import com.example.hotel.service.ResidentService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.sql.Date;
import java.util.List;


@Service
public class ResidentServiceImpl implements ResidentService {
    @Autowired
    private ResidentDao residentDao;
    @Override
    public List<Resident>  findAll()
    {
        return residentDao.findAll();
    }
    @Override
    public int add(Resident resident) {
        return residentDao.add(resident);
        //System.out.println(1/0);

    }

    @Override
    public int update(int customId ,String state)
        {
            return residentDao.update (customId,state);
        }
    @Override
        public int delete ( int customId)
        {
            return residentDao.delete(customId);
        }

}
